Skip to content

Replace PriorExtractorContext with PriorDistributionAccumulator #907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025

Conversation

mhauru
Copy link
Member

@mhauru mhauru commented May 2, 2025

I forgot about TuringLang/Turing.jl#2537 before implementing this, but I guess it's still a simple improvement even if soon it'll all be redone.

@mhauru mhauru requested a review from penelopeysm May 2, 2025 13:17
Copy link
Contributor

github-actions bot commented May 2, 2025

Benchmark Report for Commit 2176a07

Computer Information

Julia Version 1.11.5
Commit 760b2e5b739 (2025-04-14 06:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × AMD EPYC 7763 64-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver3)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

Benchmark Results

|                 Model | Dimension |  AD Backend |      VarInfo Type | Linked | Eval Time / Ref Time | AD Time / Eval Time |
|-----------------------|-----------|-------------|-------------------|--------|----------------------|---------------------|
| Simple assume observe |         1 | forwarddiff |             typed |  false |                  8.7 |                 1.6 |
|           Smorgasbord |       201 | forwarddiff |             typed |  false |                690.2 |                41.7 |
|           Smorgasbord |       201 | forwarddiff | simple_namedtuple |   true |                429.7 |                52.0 |
|           Smorgasbord |       201 | forwarddiff |           untyped |   true |               1248.3 |                28.5 |
|           Smorgasbord |       201 | forwarddiff |       simple_dict |   true |               8192.1 |                22.1 |
|           Smorgasbord |       201 | reversediff |             typed |   true |               1555.8 |                26.7 |
|           Smorgasbord |       201 |    mooncake |             typed |   true |               1015.8 |                 5.0 |
|    Loop univariate 1k |      1000 |    mooncake |             typed |   true |               5981.4 |                 3.9 |
|       Multivariate 1k |      1000 |    mooncake |             typed |   true |               1026.3 |                 8.8 |
|   Loop univariate 10k |     10000 |    mooncake |             typed |   true |              66825.6 |                 3.6 |
|      Multivariate 10k |     10000 |    mooncake |             typed |   true |               9261.5 |                 9.5 |
|               Dynamic |        10 |    mooncake |             typed |   true |                134.6 |                13.4 |
|              Submodel |         1 |    mooncake |             typed |   true |                 13.2 |                 6.2 |
|                   LDA |        12 | reversediff |             typed |   true |               1861.9 |                 2.4 |

Copy link

codecov bot commented May 2, 2025

Codecov Report

Attention: Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.

Please upload report for BASE (breaking@299e17b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/extract_priors.jl 81.81% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             breaking     #907   +/-   ##
===========================================
  Coverage            ?   84.52%           
===========================================
  Files               ?       37           
  Lines               ?     4052           
  Branches            ?        0           
===========================================
  Hits                ?     3425           
  Misses              ?      627           
  Partials            ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +132 to +134
# TODO(mhauru) This doesn't actually need the NumProduceAccumulator, it's only a
# workaround for the fact that `order` is still hardcoded in VarInfo, and hence you
# can't push new variables without knowing the num_produce. Remove this when possible.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great comment lol

@mhauru mhauru merged commit 326d7ed into breaking May 8, 2025
18 of 19 checks passed
@mhauru mhauru deleted the mhauru/extract-priors-accumulator branch May 8, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants